package com.springboot.demo.mapper;

import com.springboot.demo.entity.CentralMonitor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author wubc683
 * @desc
 * @date 2021-11-29 10:26
 */
public interface CentralMonitorMap {
    @Select("select id,name,ownerId from web_central_monitor where ownerId = #{uid}")
    List<CentralMonitor> getAllCentralMonitor(Long uid);

    @Insert("insert into web_central_monitor(name,ownerId) values(#{name},#{uid})")
    void saveCentralMonitor(Long uid,String name);

    @Update("update web_central_monitor set name = #{name} where id = #{cid}")
    void updateCentralMonitor(Long cid, String name);

    @Select("select id,name,ownerId from web_central_monitor where id = #{cid}")
    CentralMonitor getCentralMonitorById(Long cid);

    @Delete("delete from web_central_monitor where id = #{cid}")
    void deleteCentralMonitor(Long cid);
}
